﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Data;
using MySql.Data.MySqlClient;
using System.Configuration;
using System.Web.Configuration;
using System.Text;



namespace ReconUI
{
    public partial class DBCleanupPage : System.Web.UI.Page
    {
        //Initialize mysql connection  

        MySqlConnection connection = new MySqlConnection(WebConfigurationManager.ConnectionStrings["mySQLConnection"].ToString());

        protected void Page_Load(object sender, EventArgs e)
        {

        }
       
        protected void btnClean_Click(object sender, EventArgs e)
        {
            

            try
            {

                connection.Open();
               // MySqlCommand myCommand = new MySqlCommand("RRCleanDB", connection);
              //  myCommand.CommandType = System.Data.CommandType.StoredProcedure;
                MySqlCommand cmd = new MySqlCommand("SELECT RRCleanDB()",connection);
                //cmd.CommandType = CommandType.Text;
               // cmd.ExecuteNonQuery();
                var f = (int)cmd.ExecuteScalar();
                cmd.Dispose();



             //   MySqlDataAdapter adapter = new MySqlDataAdapter(cmd);
                
               // adapter.Fill(ds, "CustomerDetails");
            }
            catch (Exception exc)
            {
                throw exc;
            }
            finally
            {
                connection.Close();
            }
        }
    }
}